<?php
/*
 * @Author: CHINAKAIYUAN<sunkaiyuan@namenode.cn>
 * @Date: 2022-02-03 00:33:05
 * @LastEditTime: 2022-08-25 21:33:51
 * @LastEditors: CHINAKAIYUAN
 * @Description: 
 */

namespace App\Models;

use App\Traits\MaterialTrait;

class OpenCardRaws extends BaseModel
    {
    use MaterialTrait;
    public $timestamps = true;
    public $table = "sys_open_card_raws";
    protected $guarded = [];

    public function process()
        {
        return $this->belongsTo(ProProcesses::class);
        }
    public function ground_fabric_strage()
        {
        return $this->hasOne(OpenCardGroundFabric::class, "main_id");
        }
    public function glue_storage()
        {
        return $this->hasOne(OpenCardGlue::class, "main_id");
        }
    public function main()
        {
        return $this->belongsTo(OpenCard::class);
        }
    public function point_stick()
        {
        return $this->belongsTo(PointStick::class);
        }
    public function newmaterial()
        {
        return $this->belongsTo(Material::class);
        }
    }
